package cc.admin.modules.quartz.job;

import cc.admin.common.sys.vo.LoginUser;
import cc.admin.common.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;

/**
 * 示例不带参定时任务
 *
 * @Author Scott
 */
@Slf4j
public class SampleJob extends AbstractJob {

	@Override
	public void doExecute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();

		System.out.println(loginUser.getTenantId()+"--------------------:"+loginUser.getUsername()+loginUser.getRealname());
		log.info(String.format(" CcAdmin 普通定时任务 SampleJob !  时间:" + DateUtils.getTimestamp()));
		Trigger trigger = jobExecutionContext.getTrigger();
		trigger.getJobKey();
	}
}
